//
//  QuCanTuanViewController.m
//  1243
//
//  Created by ym on 16/7/6.
//  Copyright © 2016年 1243. All rights reserved.
//

#import "QuCanTuanViewController.h"
#import "btnView.h"
#import "CZCountDownView.h"
#import "timeView.h"
@interface QuCanTuanViewController ()
{
    dispatch_source_t _timer;
}
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *ScroViewWidth;
@property (weak, nonatomic) IBOutlet UIScrollView *scroView;
@property (weak, nonatomic) IBOutlet UIView *TimeView;
@property (weak, nonatomic) IBOutlet UILabel *hourLabel;
@property (weak, nonatomic) IBOutlet UILabel *minuteLabel;
@property (weak, nonatomic) IBOutlet UILabel *secondLabel;

@property (nonatomic,strong)UILabel *dayLabel;
@end


@implementation QuCanTuanViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationController.navigationBar.translucent = NO;
    [self creatBtn];
    [self creatTimeiew];

}

- (void)creatBtn{
    self.ScroViewWidth.constant = WIDTH/2 *10;
    self.scroView.showsVerticalScrollIndicator = NO;
    self.scroView.showsHorizontalScrollIndicator = NO;
    for (NSInteger i = 0; i < 10; i ++) {
        
        btnView *view = [[btnView alloc] initWithFrame:CGRectMake(WIDTH / 2 * i, 0, WIDTH / 2, 128)];
        [self.scroView addSubview:view];
        view.btnImage = [UIImage imageNamed:@"[UIImageView _needsSetup][UIImageView _needsSetup]"];
        view.labelStr = @"qqq";
    }
}
- (void)creatTimeiew{

    // 封装后
    timeView *countDown = [timeView countDown];
    countDown.frame = CGRectMake(0, 0, WIDTH, 30);
    countDown.timestamp = 61;
    countDown.center = self.TimeView.center;
//    countDown.backgroundImageName = @"search_k";
    countDown.timerStopBlock = ^{
        NSLog(@"时间停止");
    };
    [self.view addSubview:countDown];

}

-(NSString *)getyyyymmdd{
    NSDate *now = [NSDate date];
    NSDateFormatter *formatDay = [[NSDateFormatter alloc] init];
    formatDay.dateFormat = @"yyyy-MM-dd";
    NSString *dayStr = [formatDay stringFromDate:now];
    
    return dayStr;
    
}
@end
